<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>人员管理</title>
    <link rel="stylesheet" href="../../js/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-select/dist/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.css">

    <script src="../../js/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="../../js/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="../../js/bower_components/bootbox.min.js"></script>
    <script src="../../js/bower_components/bootstrap-select/js/bootstrap-select.js"></script>
    <script src="../../js/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>

    <script src="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.js"></script>
    <script src="../../js/bower_components/jquery-form-validator/form-validator/jquery.form-validator.min.js"></script>
    <script src="../../js/bower_components/moment/min/moment-with-locales.min.js"></script>

    <script>
        $(function () {
            $("table").bootstrapTable({locale:'zh-CN'});
            initDictType();
            createTable();
        });
        function createTable() {
            $("#tblResult").bootstrapTable('destroy');
            $("#tblResult").bootstrapTable({
                //url:"bookServlet",
                data:'employee.json',
                method:'post',
                pagination: true,
                sidePagination:'client',//'server',
                singleSelect: false,
                clickToSelect: true,
                contentType:'application/x-www-form-urlencoded; charset=UTF-8',
                queryParams:function(param) {
                    return {
                        'pageSize':param.limit,
                        'pageIndex':(param.offset / param.limit),
                        'press':$('#pressCategory').val(),
                        'author':$('#txtAuthorName').val(),
                        'publishtime':$('#tbxInstockDate').val(),
                        'edition':$('#cbkConsumptive').bootstrapSwitch('state')
                    };
                },
                onClickRow:function(row){
                    //alert(row.bid);
                    gbid=row.bid;
                },
                onCheck:function(row){
                    //alert(row.bid);
                },
                responseHandler:function(res){
                    return {
                        "total": res.total,//总页数
                        "rows": res.rows //数据
                    };
                },
                columns: [
                    {field:'empno',title:"<span class='glyphicon glyphicon-tags' /> 编号", halign:'center'},
                    {field:'namecn', title:"姓名", halign:'center'},
                    {field:'dept', title:"登录账号", halign:'center'},
                    {field:'reporttoname', title:"是否启用", halign:'center'}
                ]
            });
        }
        function initDictType() {
            $('#selDept').empty();
            option = new Option("全部","-1");
            $('#selDept').append(option);
            $('#selDept').selectpicker("refresh");
            $('#selDept').selectpicker("render");
        }
    </script>


</head>
<body>
<div class="container-fluid">
    <div class="row col-md-10">
        <div id="divSearchForm" class="form-inline">
            <div class="form-group">
                <label class="control-label" for="tbxNamecn">编号：</label>
                <input class="form-control" type="text" id="tbxNamecn" />
            </div>
            <div class="form-group">
                <label class="control-label" for="selDept">所在班级：</label>
                <select id="selDept" ></select>
            </div>
            <div class="form-group">
                <button type="button" id="btnSearch" class="btn btn-primary">
                    <span class="glyphicon glyphicon-search" />
                    检索Search
                </button>
            </div>
        </div>
    </div>
    <div class="row col-md-10" style="margin-top: 10px;">
        <table id="tblResult"></table>
    </div>
</div>


</body>
</html>
